﻿using System;

namespace Creventive.Wpf.ShellFactory.Services
{
    internal class ObjectLifetimeServiceFactory : IServiceFactory
    {
        private WeakReference objectReference;

        public ObjectLifetimeServiceFactory(object obj)
        {
            this.objectReference = new WeakReference(obj);
        }

        public object Create(IServiceContainer serviceContainer)
        {
            return this.objectReference.Target;
        }
    }
}